package com.yaoq.observer.simple;


/**
 * @ClassName Client
 * @Description 模拟实现气象站发布气温，百度自动更新温度
 * @Author yaoqiang
 * @Date 2020/9/3 14:45
 * @Version 1.0
 */
public class Client {
    public static void main(String[] args) {
        //创建一个气象站数据
        WeatherData weatherData = new WeatherData();
        //创建百度网站
        BaiduSite baiduSite = new BaiduSite();
        //把观察者百度注册到weatherData
        weatherData.registerObserver(baiduSite);
        //测试
        System.out.println("通知各个观察者看看信息");
        //气象站更新气温
        weatherData.setData(10f);
    }
}
